import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/index',
      component: () => import('@/views/index.vue'),
      children: [
        {
          path: '/index',
          name: 'index',
          component: () => import('@/views/index/index.vue'),

        },
        {
          path: '/playlist',
          name: 'playlist',
          component: () => import('@/views/playlist/index.vue'),
        },
        {
          path: '/rank',
          name: 'toplist',
          component: () => import('@/views/rank/index.vue'),

        },
        {
          path: '/mv',
          name: 'mv',
          component: () => import('@/views/mv/index.vue'),

        },
        {
          path: '/user/home',
          name: 'home',
          component: () => import('@/views/user/home/index.vue'),
        },
        {
          path: '/kun/list',
          name: 'list',
          component: () => import('@/views/kun/list/index.vue'),
        },
        {
          path: '/song', name: 'song', component: () => import('@/views/song/index.vue'),
        },
        {
          path: '/playlist/detail',
          name: 'playlistdetail',
          component: () => import('@/views/playlist/detail/index.vue'),
        },
        {
          path: '/mv/detail',
          name: 'mvdetail',
          component: () => import('@/views/mv/detail/index.vue'),
        },
        {
          path: '/search',
          name: 'search',
          component: () => import('@/views/search/index.vue'),
        },
      ]
    }
  ]
})

export default router
